﻿using System.Web.Mvc;
using DevFramework.Business.Concrete.Managers;

namespace DevFramework.MvcUI.ModelBinders
{
    public class CartModelBinder : IModelBinder
    {
        public object BindModel(ControllerContext controllerContext, ModelBindingContext bindingContext)
        {
            return controllerContext.HttpContext.Session["Cart"] ??
                   (controllerContext.HttpContext.Session["Cart"] = new CartManager());
        }
    }
}